package com.haiyan.demo08_super关键字的使用总结;

class Fu{
    int num=10;
    public void method01()
    {
        System.out.println("Fu method01方法");
    }
    public Fu()
    {
        System.out.println("Fu 空参");
    }
    public Fu(int num)
    {
        this.num=num;
        System.out.println("有参");
    }
}
class Zi extends Fu{
    int num=20;
    public void show()
    {
        int num=30;
        System.out.println("局部变量num:"+num);
        System.out.println("本类的成员变量num:"+this.num);
        System.out.println("父类的成员变量num:"+super.num);
    }

    @Override
    public void method01() {
        super.method01();
        System.out.println("Zi method01方法");
    }
    public Zi()
    {
        super(10);
        System.out.println("Zi 空参");
    }
}
public class Test {
    public static void main(String[] args) {
        Zi zi=new Zi();
        zi.show();
        zi.method01();
    }
}
